<template>
    <view class="recycling">
        <!-- 回收头部 -->
        <view class="recycling-top">
            <view class="top-top" @click="openCardType">
                <view class="top-left">
                    <view class="left-left">
											<image v-if="race.image" :src="race.image.file_path" class="iocn5" mode="aspectFit"></image>
											<image v-else src="@/static/default_img/default.png" class="iocn5"></image>
                    </view>
                    <view class="left-right">
                        <view class="right-text">
                            <view class="text">
                                {{race.goods_name?race.goods_name:'请选择卡种'}}
                            </view>
<!--                            <view class="text-img">
                                <image src="/static/Rectangle1.png" class="Rectangle1"></image>
                                 <image src="/static/Rectangle3.png" class="Rectangle3"></image>
                                <view class="img-text">
                                    0.1小时
                                </view>
                               
                            </view> -->
                        </view>
                        <view class="right-wzi">
                            归属类型 {{kind.name?kind.name:'请选择卡类'}}
                        </view>
                    </view>
                </view>
                <view class="top-right">
                     <image src="/static/Rectangle2.png" class="Rectangle2"></image>
                </view>
            </view>
            <view class="mzhi " @click="openFace">
                <view class="mzhi-left">
                    <view class="left-left">
                        <view class="left-item">
                            <view class="item-tite">
                                面值
                            </view>
                            <view class="item-num" v-if="goods_sku.face_value">
                               
                                {{goods_sku.face_value === "0.00"?custom_yes:goods_sku.face_value}}
                            </view>
                        </view>
                        <view class="left-item">
                            <view class="item-tite">
                                回收价
                            </view>
                            <view class="item-num" v-if="goods_sku.face_value">
                                  {{discount_show((goods_sku.face_value === "0.00"?custom_yes:goods_sku.face_value) * discount(goods_sku.api_discount))}}/{{Number(goods_sku.api_discount)}}折
                               
                            </view>
                        </view>
                    </view>
                </view>
                <view class="mzhi-right" >
                    <image  src="/static/left.png" class="left"></image>
                </view>
            </view>
        </view>
				<view v-if="goods_sku.form_num">
					<!-- 卡号 -->
					<view v-if="postType === 1">
						<view class="Card" >
						    <view class="Card-item" v-if="goods_sku.form_num == 1  || goods_sku.form_num==2 || goods_sku.form_num == 7 || goods_sku.form_num === 9">
						        <view class="item-left">
						            卡号
						        </view>
						        <view class="item-right">
						             <input type="text" class="input"  placeholder="请输入礼品卡卡号" v-model="card" @input="OnInput_card()" />
						        </view>
						    </view>
						    <view class="Card-item" v-if="goods_sku.form_num == 1 || goods_sku.form_num==3 || goods_sku.form_num == 7 || goods_sku.form_num === 8 || goods_sku.form_num === 9">
						        <view class="item-left">
						            卡密
						        </view>
						        <view class="item-right">
						             <input type="text" class="input" placeholder="请输入礼品卡卡密" v-model="card_pass" @input="OnInput()" />
						        </view>
						    </view>
								<view class="Card-item" v-if="race.goods_name === '瑞祥商联卡' || race.goods_name ==='福卡(裕福)' || goods_sku.form_num === 9">
								    <view class="item-left">
								        CVV
								    </view>
								    <view class="item-right">
								         <input type="text" class="input" :placeholder="race.goods_name === '瑞祥商联卡'?'请输入CVV码':'请输入验证码'"  v-model="cvv_code"  />
								    </view>
								</view>
								<view class="" v-if="goods_sku.form_num===6 || goods_sku.form_num === 4">
									<view class="flex flex-wrap ">
										<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
											<image class="uploadimg-preview" :src="item.file_path" mode="aspectFill"></image>
											<view class="iconfont icon-shanchu" @tap.stop="DelImg" :data-index="index"></view>
										</view>
										<view class="picture" @click="ChooseImage" v-if="postType===1?imgList.length < 1:imgList.length < 10">
												<image src="@/static/user/picture@2x.png" class="imgs"></image>
												<view class="text">
														图片/视频
												</view>
										</view>
									</view>
								</view>
								<view class="item-text" v-if="goods_sku.form_num == 5">
								   <textarea 
										placeholder='请输入'
										maxlength="999999999"
										v-model="text_tar"
										class="txet"></textarea>
								</view>
						</view>
						<view class="tji"  @click="activeType(2)">
						    <view class="tji-item" >
						        批量提交
						    </view>
						</view>
					</view>
					
					<!-- 批量提交 -->
					<view v-if="postType === 2">
						<view class="item-text" v-if="goods_sku.form_num != 4 && goods_sku.form_num != 6 && goods_sku.form_num!=5">
						   <textarea 								
								maxlength="-1"
								@input="inputT"  
								v-model="txt" 
								placeholder="每张卡占用一行，卡号卡密之间用“空格”隔开" 
								class="txet"></textarea>
						</view>
						<view class="item-text" v-if="goods_sku.form_num == 5">
							 <textarea 
								placeholder='请输入'
								maxlength="99999999" 
								v-model="text_tar_batch"
								class="txet"></textarea>
						</view>
						<view class="Card" v-if="goods_sku.form_num===6 || goods_sku.form_num === 4">
							<view class="flex flex-wrap ">
								<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
									<image class="uploadimg-preview" :src="item.file_path" mode="aspectFill"></image>
									<view class="iconfont icon-shanchu" @tap.stop="DelImg" :data-index="index"></view>
								</view>
								<view class="picture" @click="ChooseImage" v-if="postType===1?imgList.length < 1:imgList.length < 10">
										<image src="@/static/user/picture@2x.png" class="imgs"></image>
										<view class="text">
												图片/视频
										</view>
								</view>
							</view>
						</view>
						<view class="tji1 tji"  >
						    <view class="item-img" @click="clearTextAre()" v-if="goods_sku.form_num != 4 && goods_sku.form_num != 6 && goods_sku.form_num!=5">
									 <image src="/static/Rectangle4.png" class="Rectangle4"></image>
									 <view class="text">
											 整理卡密
									 </view>
						    </view>
								<view v-else class="item-img"></view>
						    <view class="tji-item" @click="activeType(1)">
						        返回单张提交
						    </view>
						</view>
					</view>
					<!-- 回收说明 -->
					<view class="user  " v-if="goods_sku.product_desc">
							<view class="user-top">
									回收说明
							</view>
							{{goods_sku.product_desc}}
					</view>
					<!-- 用户须知 -->
					<view class="user marta">
							<view class="user-top">
									用户须知
							</view>
							<reminder :userContent="goods_sku.user_notice?goods_sku.user_notice:userContent"></reminder>
					</view>

				</view>

      <view class="bottom">
          <view class="bottom-left">
              <view class="left">
                  <view class="left-text">
                     共{{postType === 2?line:1}}张，合计
                  </view>
                
              </view>
              <view class="right-text">
                <view class="text">
                     ￥
                 </view>
                 <view class="num">
                     {{postType == 2?Number(line) * Number(goods_sku.face_value === "0.00"?custom_yes:goods_sku.face_value)  : Number(goods_sku.face_value === "0.00"?custom_yes:goods_sku.face_value) }}
                 </view>
              </view>
          </view>
          <view class="bottom-right" @click="postOrder">
              <!-- <image src="../../static/awal6@2x.png" mode=""></image> -->
              <view class="awal6">
                  
              </view>
              <view class="text">
                  确认提交
              </view>
          </view>
      </view>
			<pop ref="goodsDetailPop" @qwdqwfgght="openImg" :cardCodeDetail="cardCodeDetail" @handleKz="handleKz" @handleCardType="handleCardType" @handleFace="handleFace" @handleCounpon="handleCounpon"></pop>
			<popRest ref="popRestmain" @postTj="postTj" :kind="kind"></popRest>
    </view>
    
</template>

<script>
	import * as Api from '@/api/good_detail.js'
	import * as userApi from '@/api/user.js'
	import pop from './components/pop.vue'
	import popRest from './components/popRest.vue'
	import config from '@/config.js'
	import reminder from './components/reminder.vue'
	import withdrawItem from '@/components/withdrawItem/index.vue'
	import * as couponApi from '@/api/coupon.js'
	export default{
		data(){
			return{
				options:{},
				categoryList:[],
				kind:{},
				goodsList:[],
				race_id:"",
				race:{},
				goodsSkuList:[],
				goods_sku:{},
				date:"",

				postType:1,

				imgList:[],
				txt:"",
				text_tar_batch:"",
				text_tar:"",
				line:0,

				cvv_code:"",
				card:"",
				card_pass:"",

				userInfo:{},
				date_now:new Date().toISOString().slice(0, 10),
				time_number:"",
				new_batchBuy:[],
				arr_submit:[],
				old_line:"",
				repetiton:0,
				custom_yes:"",
				file_id:[],
				userContent:"",
				couponDeatil:{},
				couponList:[],
				couponType:"",
				levelType:"",
				cardCodeDetail:{},
				indexfalg:false
			}
		},
		onLoad(options) {
			this.getInformation(options)
			this.getProductNotice()
		},
		async onShow() {
			let token = uni.getStorageSync("AccessToken")
			await this.coupontype()
			this.membertype()
			this.cardCode()
			if(token){
				this.userInfo_obj()
				this.getCouponList()
			}
			let couponDeatil = uni.getStorageSync("coupon")
			if(couponDeatil){
				this.couponDeatil = JSON.parse(couponDeatil) 
				uni.removeStorageSync('coupon')
			}else{
				this.couponDeatil = {}
			}
		},
		components:{
			pop,
			reminder,
			popRest
		},
		methods:{
			cardCode(){
				Api.cardorcode()
				.then(result => {
					this.cardCodeDetail = result.data
				})
			},
			membertype(){
				userApi.membertype()
				.then(result => {
					let type = ""
					// #ifdef APP-PLUS
					if(this.$fxLink.checkfacility() === 1){
						type = Number(result.data.android)
					}else if(this.$fxLink.checkfacility() === 2){
						type = Number(result.data.ios)
					}else{
						type = Number(result.data.type)
					}
					// #endif
					// #ifndef APP-PLUS
					type = Number(result.data.type)
					// #endif
					this.levelType = type
				})
			},
			coupontype(){
				return new Promise((relove,reject) => {
					couponApi.coupontype()
					.then(result => {
						relove(result)
						this.couponType = Number(result.data.type)
					})
				})
			},
			openLevle(){
				uni.navigateTo({
					url:"/pageace_ali/pages/user/level/level"
				})
			},
			openImg(){

				uni.previewImage({
					urls:[this.cardCodeDetail.file_path]
				})
			},
			handleCounpon(item){
				this.couponDeatil = item
			},
			spreadPrice(old_discount,new_discount,face_value){
				return new_discount?((Number(new_discount) - Number(old_discount)) / 100 * Number(face_value)).toFixed(2) :0
			},
			getCouponList(){
				couponApi.cardpackage({
					page:1,
					type:0
				})
				.then(result => {
					this.couponList = result.data.data
				})
			},
			openCardBag(){
				if(this.couponType === 1){
					let token = uni.getStorageSync("AccessToken")
					if(!token){
						this.$fxLink.checkLoinjudge()
						return
					}
					this.$refs.goodsDetailPop.handCounpon(this.couponDeatil,this.goods_sku)
				}
			},
			day_time2(day_inp,day_now){
				let a = day_inp.replace(/\-/g, "/") ;
				let b = day_now.replace(/\-/g, "/") ;
				a = a.split('/')
				b = b.split("/")
				
				let num = 0
				let num1 = 0
				let num2 = 0
				let day = 0
				if(a[0] === b[0]){
					
				}else{
					num = a[0]-b[0]
				}
				if(a[1] === b[1]){
					
				}else{
					 num1 = a[1] - b[1]
				}
				if(a[2] === b[2]){
					
				}else{
					 num2 = a[2] - b[2]
				}
				if(num != 0){
					day += 365*num
				}
				if(num1 !=0 ){
					day += num1 * 30
				}
				if(num2 != 0){
					day += num2
				}
				this.time_number = day
			},
			changeTime(e){
				this.date = e;
			},
			winEmpty(){
				this.card = "";
				this.card_pass = "";
				this.txt = ""
				this.file_id = []
				this.imgList = []
				this.new_batchBuy = "" 
				this.date = ''
				this.time_number = ''
				this.text_tar_batch = ''
				this.text_tar = ""
				this.line = 0
				this.cvv_code = ''
				this.couponDeatil = {}
			},
			// 单卡提交
			oncePostOrder_obj(){
				let _this = this
				let type = this.$fxLink.checkGain()
				let token = uni.getStorageSync("AccessToken")
				if(this.custom_yes){
					if(this.custom_yes < 1){
						this.$toast("面值必须大于1")
						return
					}
				}
				let card = _this.card
				let card_pass = _this.card_pass
				let validity = this.goods_sku.form_num === 7?this.Aspro_datem:this.race.goods_name === '瑞祥商联卡' || this.race.goods_name === '福卡(裕福)' || this.goods_sku.form_num === 9?this.cvv_code:""
				if(this.race.goods_name === "京东e卡(全品类)"){
					if(card.indexOf('-') != -1){
						card = card.replace(/[-]/g,'')
					}
					if(card_pass.indexOf('-') != -1){
						card_pass = card_pass.replace(/[-]/g,'')
					}
					card = card.replace(/[o,O]/g,'0')
					card_pass = card_pass.replace(/[o,O]/g,'0')
				}
				if(this.goods_sku.form_num === 8){
					if(card_pass.indexOf('-') != -1){
						card_pass = card_pass.replace(/[-]/g,'')
			
					}
					card = card_pass
					card = card.replace(/[o,O]/g,'0')
					card_pass = card_pass.replace(/[o,O]/g,'0')
					// this.card = this.card_pass
				}
				let coupons_id = this.couponDeatil.id?this.couponDeatil.id:''
				Api.postOrder({
						wxapp_id: _this.$wxapp_id,
						token: token,
						product_no:_this.goods_sku.product_no,
						card: card,
						card_pass: card_pass,
						card_date: this.time_number,
						images : this.imgList?this.file_id:"",
						texts:this.text_tar?this.text_tar:"",
						form_face:this.custom_yes?this.custom_yes:"",
						type,
						validity:validity,
						coupons_id
					})
					.then(result => {
						if (result.code == 1) {
							this.$refs.popRestmain.handPostSuccess()
							this.winEmpty()
						} else {
							this.$refs.popRestmain.handPostError(result.msg)
						}
					})
					.finally(() => _this.isLoading = false)
			},
			// 批量提交
			batchPostOrder_obj(){
				let _this = this
				let type = this.$fxLink.checkGain()
				let token = uni.getStorageSync("AccessToken")
				Api.batchPostOrder({
						wxapp_id: _this.$wxapp_id,
						token: token,
						product_no:_this.goods_sku.product_no,
						// #ifdef MP-ALIPAY
						batchBuy: [this.new_batchBuy],
						// #endif
						// #ifndef MP-ALIPAY
						batchBuy: this.new_batchBuy,
						// #endif
						form_face:this.custom_yes?this.custom_yes:"",
						card_date: this.time_number,
						type
					})
					.then(result => {
						if (result.code == 1) {
							this.$refs.popRestmain.handPostSuccess()
							this.winEmpty()
						} else {
							this.$refs.popRestmain.handPostError(result.msg)
						}
				
					})
					.finally(() => _this.isLoading = false)
			},
			postTj(){
				if(this.postType === 1){
					this.oncePostOrder_obj()
				}else{
					this.batchPostOrder_obj()
				}
			},
			// 数组去重
			list_picnice(list){
				let num =  list.length
				this.old_line = num
				let set = new Set(list)
				this.new_batchBuy = [...set]
				this.repetiton = num - this.new_batchBuy.length
				this.line = this.new_batchBuy.length
			},
			claernNull(list){
				if(list.indexOf("") != -1){
					list.splice(list.indexOf(""),1)
				}
				return list
			},
			getProductNotice(){
				Api.getNotice({
					type:1
				})
				.then(result => {
					this.userContent = result.data.content
				})
			},
			clearTextAre(){
				if(this.goods_sku.card_length != 0 && this.goods_sku.pass_length != 0){
					this.clear1()
				}else{
					this.clear()
				}
			},
			//批量提交 卡号考密有规则时 点击整理或者提交触发
			clear1(){
				let str = this.txt;
				var arr = str.split("\n");
				if(this.goods_sku.card_length === this.goods_sku.card_short && this.goods_sku.pass_short === this.goods_sku.pass_length){
					if(str){
						
					}else{
						this.$toast("内容不能为空")
					}
					for(let i=0;i<arr.length;i++){
						arr[i] = arr[i].replace(/\s/g,"")
						if(arr[i]){
							let c = arr[i].substring(0,this.goods_sku.card_length)
							let d = arr[i].substring(this.goods_sku.card_length)
							arr[i] = c + ' ' + d
							if(d.length > this.goods_sku.pass_length){
								if(arr[i+1]){
									arr[i+1] = arr[i].substring(this.goods_sku.card_length+this.goods_sku.pass_length+1) + arr[i+1]
									arr[i] = arr[i].substring(0,this.goods_sku.card_length+this.goods_sku.pass_length+1)
								}else{
									arr.push(arr[i].substring(this.goods_sku.card_length+this.goods_sku.pass_length+1))
									arr[i] = arr[i].substring(0,this.goods_sku.card_length+this.goods_sku.pass_length+1)
								}
							}
						}
					}
					// 一行不够下一行自动补齐
					let pdCard = this.goods_sku.card_length+this.goods_sku.pass_length + 1
					for(let i=0;i<arr.length;i++){
						if(arr[i].length < pdCard){
							if(arr[i+1]){
								if(arr[i+1].length >= (pdCard-arr[i].length)){
									let string = arr[i+1].substring(0,pdCard-arr[i].length)
									let string1 = arr[i+1].substring(pdCard-arr[i].length)
									arr[i] = arr[i]+string
									arr[i+1] = string1
								}else{
									arr[i] = arr[i] + arr[i+1]
									arr.splice(i+1,1)
								}
							}
						}
					}
					if(this.txt){
						
					}else{
						this.$toast("内容不能为空")
					}
				}
				for(let i=0;i<arr.length;i++){
					if(arr[i] === '' || arr[i] === " "){
						arr.splice(i,1)
					}
				}
				
				let b = ''
				if(this.race.goods_name === "京东e卡(全品类)"){
					for(let i=0;i<arr.length;i++){
						if(arr[i].indexOf(' ') === -1){
							let jd1 = arr[i].substring(0,arr[i].length-this.goods_sku.pass_length)
						
							let jd2 = arr[i].substring(arr[i].length-this.goods_sku.pass_length)
							arr[i] = jd1+' '+jd2
						}
					}
				}
				for(let i=0;i<arr.length;i++){
					if(i<arr.length-1){
						 b += arr[i]+'\n'
					}else{
						b += arr[i]
					}
				}
				this.txt = b
				this.arr_submit = arr
				this.line = this.arr_submit.length
				if(this.race.goods_name === "京东e卡(全品类)"){
					for(let i=0;i<this.arr_submit.length;i++){
						if(this.arr_submit[i].indexOf('-') != -1){
							this.arr_submit[i] = this.arr_submit[i].replace(/[-]/g,'')
						}
					}
				}
			},
			// 批量提交卡号卡密无规则时触发
			clear(){
				if(this.goods_sku.form_num === 4 || this.goods_sku.form_num === 6 || this.goods_sku.form_num === 3 || this.goods_sku.form_num === 2 || this.goods_sku.form_num === 8){
					let str = this.txt
					var arr = str.split("\n");
					let list = []
					for(let i=0;i<arr.length;i++){
						if(arr[i] != ""){
							list.push(arr[i])
						}
					}
					this.txt = list.join('\n')
					return
				}
				let str = this.txt;
				const replaceStr2 = (str, index, char) => {
				 return str.substring(0, index) + char + str.substring(index + 1);
				 }
				// 按空格就回车 this.txt = str.replace(/\s/g,"\n")
				var arr = str.split("\n");
				let num = 0
				let num1 = []
				
				for(let i=0;i<arr.length;i++){
						num1 = []
					for(let j=0;j<arr[i].length;j++){
						
						if(arr[i][j] === " "){
							if(j === 0 || j===arr[i].length-1){
								let b =replaceStr2(arr[i], j, '')
								arr[i] = b
								continue
							}
							
							num += 1
							num1.push(j)
							
						}
						if(num > 1){
			
							arr[i] = arr[i].replace(/\s/g,"")
							if(arr[i]){
									let b  = arr[i].substring(0,num1[0]) + ' ' + arr[i].substring(num1[0])
									arr[i] = b
							}
							num -= 1
						}
					}
					num = 0
				}
				let list = []
				for(let i=0;i<arr.length;i++){
					if(arr[i] != ''){
						list.push(arr[i])
					}
				}
				this.arr_submit = list
				this.line = this.arr_submit.length
				
				let b_txt = ''
				
				for(let i=0;i<list.length;i++){
					if(i<list.length-1){
						 b_txt += list[i] + '\n'
					}else{
						b_txt += list[i]
					}
					
				}
			
				this.txt = ''
				setTimeout(() => {
					this.txt = b_txt
					if(this.arr_submit.length > 0){
					}else{
						this.$toast("内容不能为空")
						return
					}
				},10)
			},
			checkText1(str) {
			  let rowstrs = str
			    .replace(/\n/g, "")
			    .replace(/\s+/g, "")
			    .replace(/([^\u0000-\u00FF])/g, "")
			    .replace(/-/g, "");
			  let newarrys = "";
			  if (
			    this.goods_sku["card_length"] > 0 &&
			    this.goods_sku["pass_length"] > 0
			  ) {
			    while (rowstrs.length > 0) {
			      if (rowstrs.length >= this.goods_sku["card_length"]) {
			        let cNo = rowstrs.substring(0, this.goods_sku["card_length"]);
			        let cPwd = "";
			        rowstrs = rowstrs.substring(this.goods_sku["card_length"]);
			        if (rowstrs.length >= this.goods_sku["pass_length"]) {
			          cPwd = rowstrs.substring(0, this.goods_sku["pass_length"]);
			          rowstrs = rowstrs.substring(this.goods_sku["pass_length"]);
			        } else {
			          cPwd = rowstrs;
			          rowstrs = "";
			        }
			        if (cPwd.length === this.goods_sku["pass_length"]) {
			          newarrys += cNo + (" " + cPwd + "\n");
			        } else {
			          newarrys += cNo + (" " + cPwd + "");
			        }
			      } else {
			        newarrys += rowstrs;
			        rowstrs = "";
			      }
			    }
			    this.txt = newarrys;
			  }
			},
			// 批量监听输入 （暂不优化）
			inputT(event) {
				let cardNoLength = this.goods_sku.card_length!=0?this.goods_sku.card_length:0;
				let secretLength = this.goods_sku.pass_length!=0?this.goods_sku.pass_length:0;
				let lineLength = cardNoLength + secretLength + 1;	// +1：是加上卡号和密码之间的空格长度
				let a = " "
				let str = this.txt
				var arr = str.split("\n");
				for(let i=0;i<arr.length;i++){
					if(arr[i] === ''){
						arr.splice(i,1)
					}
				}
				// 防止清空对行输入框没有内容报错
				if(!str){
					return
				}
				const Trim = (str,is_global) => {
				   var result;
				   result = str.replace(/(^\s+)|(\s+$)/g,"");
				   if(is_global.toLowerCase()=="g")
				   {
				    result = result.replace(/\s/g,"");
				    }
				   return result;
				}
				if(this.race.goods_name === '瑞祥商联卡' || this.race.goods_name === '福卡(裕福)' || this.goods_sku.form_num === 9){
					this.goods_sku.pass_length = 9
					this.goods_sku.pass_short = 9
					lineLength = cardNoLength + secretLength + 1
				}
				const replaceStr2 = (str, index, char) => {
				 return str.substring(0, index) + char + str.substring(index + 1);
				 }
				 const from_cardOrpass = (length,type,line_obj1) => {
					 let cardorpass_short = type === 1?this.goods_sku.card_short:this.goods_sku.pass_short
					 if(length != 0){
						 if(arr[line_obj1].length < cardorpass_short){
								arr[line_obj1]= arr[line_obj1].replace(/\s/g,'')
								this.txt = arr.join('\n')
						 }
					 }
					 if(arr[line_obj1].length === length){
							 arr[line_obj1]+='\n'
							 this.txt = arr.join('\n')
					 }
					 
				 }
				if(this.goods_sku.form_num == 2 || this.goods_sku.form_num == 3 || this.goods_sku.form_num == 8){
					// this.txt = str.replace(/\s/g,"")
					let result = ''
					let slist = []
					for(let i=0;i<arr.length;i++){
						result = arr[i].replace(/\s/g,"");
						slist.push(result)
					}
					this.txt = slist.join('\n')
					str = this.txt
					arr = str.split("\n");
					// 按空格就回车 
					this.txt = str.replace(/\s/g,"\n")
					let line_obj1 = arr.length - 1
					// 单卡号 卡号有规则进行整理判断
					if(this.goods_sku.form_num === 2){
						setTimeout(() => {
							from_cardOrpass(cardNoLength,1,line_obj1)
							
						},100)
					}
					// 单卡密 卡密有规则进行整理判断
					if(this.goods_sku.form_num === 3 || this.goods_sku.form_num === 8){
						this.txt = str.replace(/\s/g,"\n")
						let line_obj1 = arr.length - 1
						if(secretLength!=0){
							if(this.goods_sku.form_num === 8){
								for(let i=0;i<arr.length;i++){
									let jdarr = arr[i]
									let jd_confin = 0
									if(arr[i].indexOf('-') != -1){
										jdarr = arr[i].replace(/[-]/g,'')
										jd_confin = 1
									}
									if(jdarr.length<secretLength){
										if(arr[i+1]){
											let jdarr1 = arr[i+1]
											let jd_confin1 = 0
											if(arr[i+1].indexOf('-') != -1){
												jdarr1 = arr[i+1].replace(/[-]/g,'')
												let jd_confin1 = 1
											}let extra1 = jd_confin1 === 0?0:3
											if(jdarr.length + jdarr1.length >= secretLength){
												
												let jd_b = arr[i+1].substring(0,secretLength-jdarr.length + extra1)
												let jd_c = arr[i+1].substring(secretLength-jdarr.length + extra1)
												arr[i] += jd_b
												arr[i+1] = jd_c
											}else{
												arr[i] = arr[i] + arr[i+1]
												arr.splice(i+1,1)
											}
										}
									}
									if(jdarr.length>secretLength){
			
										let jd_length = arr[i].length-jdarr.length
										let extra = jd_confin === 0?0:3
										let jd_b = arr[i].substring(0,this.goods_sku.pass_length + extra)
										let jd_c = arr[i].substring(this.goods_sku.pass_length + extra)
										arr[i] = jd_b
										if(arr[i+1]){
											arr.splice(i+1,0,jd_c)
										}else{
											arr[i+1] = jd_c
										}
										
									}
									arr[i]= arr[i].replace(/\s/g,'')
								}
								this.txt = arr.join('\n')
							}
						}
						setTimeout(() => {
							if(this.goods_sku.form_num === 8){
								if(secretLength!=0){
									if(arr[line_obj1]){
										let jdarrlast = arr[line_obj1]
										if(arr[line_obj1].indexOf('-') != -1){
											jdarrlast = arr[line_obj1].replace(/[-]/g,'')
										}
										if(jdarrlast < secretLength){
											arr[line_obj1]= arr[line_obj1].replace(/\s/g,'')
										}
										if(jdarrlast.length === secretLength){
											 arr[line_obj1]+='\n'
											 this.txt = arr.join('\n')
										}
									}
								}
							}else{
								from_cardOrpass(secretLength,2,line_obj1)
							}
						},100)
					}
				}
				this.line = arr.length
				
				if(this.goods_sku.form_num === 1 && this.race.goods_name != "京东e卡(全品类)"){
					
					// 卡号卡密有规则
					if(this.goods_sku.card_length!=0 && this.goods_sku.pass_length != 0){
						// 粘贴的多行进行处理整理
						// if(arr.length > 1){
						// 	for(let i=0;i<arr.length;i++){
						// 		arr[i] = arr[i].replace(/\s/g,"")
						// 		arr[i] = arr[i].substring(0,this.goods_sku.card_length) + ' ' + arr[i].substring(this.goods_sku.card_length)
						// 		if(arr[i].length > lineLength){
						// 			let arr_max_length = arr[i].substring(lineLength)
						// 			arr[i] = arr[i].substring(0,lineLength)
						// 			arr[i+1] = arr_max_length
						// 			if(arr[i+1].length >= this.goods_sku.card_length){
						// 				arr[i+1] = arr[i+1].substring(0,this.goods_sku.card_length) + ' ' + arr[i+1].substring(this.goods_sku.card_length)
						// 			}
						// 		}
								
						// 		if(arr[i].length < lineLength && this.goods_sku.card_length === this.goods_sku.card_short && this.goods_sku.pass_short === this.goods_sku.pass_length && this.goods_sku.card_length !=0 &&  this.goods_sku.pass_length!=0){
						// 			if(i+1 < arr.length){
						// 				let card_pass_fz = lineLength - arr[i].length
						// 				if(arr[i+1].length > card_pass_fz){
						// 					let arr_obj_str = arr[i+1].replace(/\s/g,"")
						// 					let arr_obj_str_item = arr_obj_str.substring(card_pass_fz-1)
						// 					arr[i] = arr[i]+arr_obj_str.substring(0,card_pass_fz-1)
						// 					arr[i+1] = arr_obj_str_item
						// 					if(arr[i].length >= this.goods_sku.card_length +1 ){
						// 						let c = arr[i].substring(0,this.goods_sku.card_length)
						// 						let d = arr[i].substring(this.goods_sku.card_length)
						// 						arr[i] = c + ' ' + d
						// 					}
						// 				}else{
						// 					let card_obj = arr[i]
						// 					let pass_obj = arr[i+1]
						// 					arr[i] = card_obj + pass_obj
						// 					arr.splice(i+1,1)
						// 					if(arr[i].length >= this.goods_sku.card_length +1 ){
						// 						let c = arr[i].substring(0,this.goods_sku.card_length)
						// 						let d = arr[i].substring(this.goods_sku.card_length)
						// 						arr[i] = c + ' ' + d
						// 					}
						// 				}
						// 			}
						// 		}
						// 	}
						// 	this.txt = arr.join('\n')
						// }
						// 正常输入整理
						this.checkText1(this.txt)
						let line_obj = arr.length - 1
						if((this.goods_sku.card_length === this.goods_sku.card_short && this.goods_sku.pass_short === this.goods_sku.pass_length) || (this.goods_sku.card_length === this.goods_sku.card_short && this.goods_sku.pass_short != this.goods_sku.pass_length)){
							if(arr[line_obj].length === cardNoLength){
								this.txt += ' '
							}
							if(arr[line_obj].length === lineLength){
								this.txt += '\n'
							}
							if(arr[line_obj].length < cardNoLength){
								if(arr[line_obj].indexOf(' ') != -1){
									setTimeout(() => {
										arr[line_obj] = arr[line_obj].replace(/\s/g,"")
										this.txt = arr.join('\n')
									},100)
								}
							}
							if(arr[line_obj].length > cardNoLength+1 && arr[line_obj].length <= lineLength){
								let a = arr[line_obj].substring(0,cardNoLength+1)
								
								let b = arr[line_obj].substring(cardNoLength+1,arr[line_obj].length)
								if(b.indexOf(' ') != -1){
									b = b.replace(/\s/g,"")
									arr[line_obj] = a + b
									this.txt = arr.join('\n')
								}
							}
							this.line = arr.length
						}else if (this.goods_sku.card_length != this.goods_sku.card_short && this.goods_sku.pass_short === this.goods_sku.pass_length){
							if(arr[line_obj].length === cardNoLength && arr[line_obj].indexOf(' ') === -1){
								this.txt += ' '
							}
							if(arr[line_obj].indexOf(' ') != -1){
								let arr_obj_w = arr[line_obj].split(' ')
								if(arr_obj_w[1].length === this.goods_sku.pass_length){
									this.txt += '\n'
								}
							}
							if(arr[line_obj].length < this.goods_sku.card_short){
								if(arr[line_obj].indexOf(' ') != -1){
									setTimeout(() => {
										arr[line_obj] = arr[line_obj].replace(/\s/g,"")
										this.txt = arr.join('\n')
									},100)
								}
							}
							if(arr[line_obj].length > cardNoLength+1 && arr[line_obj].length <= lineLength){
								let a = arr[line_obj].substring(0,cardNoLength+1)
								
								let b = arr[line_obj].substring(cardNoLength+1,arr[line_obj].length)
								if(b.indexOf(' ') != -1){
									b = b.replace(/\s/g,"")
									arr[line_obj] = a + b
									this.txt = arr.join('\n')
								}
							}
							this.line = arr.length
						}
						// 卡号卡密无规则
					}else if (this.goods_sku.card_length === 0 || this.goods_sku.pass_length === 0){
						for(let i=0;i<arr.length;i++){
							let count = 0
							let str_obj = ' '
							for(let j=0;j<arr[i].length;j++){
								if(arr[i][j] === str_obj){
									count +=1
								}
								if(count > 1){
										let jq = ""
										let jq1 = ''
										jq = arr[i].substring(j)
										jq1 = arr[i].substring(0,j)
										jq = jq.split(' ').join("")
										arr[i] = jq1 +jq
										count = 1	
								}
							}
							
						}
						this.txt = arr.join('\n')
					}
			
			
				}
				if(this.race.goods_name ===	"京东e卡(全品类)"){
					this.line = arr.length
					for(let i=0;i<arr.length;i++){
						if(arr[i].indexOf(" ") != -1){
							let first_number = arr[i].indexOf(" ")
							let number = 0
							for(let z=0;z<arr[i].length;z++){
								if(arr[i][z] === ' '){
									number += 1
								}
							}
							if(number > 1){
								let a1 = arr[i].substring(0,first_number+1)
								let a2 = arr[i].substring(first_number+1).replace(/\s/g,"");
								arr[i] = a1 + a2
							}
						}
						let jdarr = arr[i]
						if(arr[i].indexOf('-') != -1){
							jdarr = arr[i].replace(/[-]/g,'')
						}
						if(jdarr.length < this.goods_sku.card_short + this.goods_sku.pass_length + 1){
							if(arr[i+1]){
								let jd_length = this.goods_sku.card_short + this.goods_sku.pass_length  - jdarr.length
								if(jdarr.length >= this.goods_sku.card_short && jdarr.length < this.goods_sku.card_length){
									jd_length = this.goods_sku.pass_length + 1
								}
								let jdarr1 = arr[i+1]
								if(arr[i+1].indexOf('-') != -1){
									jdarr1 = arr[i+1].replace(/[-]/g,'')
								}
								if(jdarr1.length >= jd_length){
									let b = arr[i+1].substring(0,jd_length)
									let c = arr[i+1].substring(jd_length)
									arr[i] = arr[i] + b
									arr[i+1] = c
									let num = arr[i].indexOf(' ')
									if(arr[i].indexOf(' ') === -1){
										let jdarr_a = arr[i]
										
										
										if(arr[i].indexOf('-') != -1){
											jdarr_a = arr[i].replace(/[-]/g,'')
										}
										let jd_card_length =arr[i].length - jdarr_a.length
										let b  = arr[i].substring(0,jdarr_a.length - this.goods_sku.pass_length+jd_card_length)
										let c = arr[i].substring(jdarr_a.length - this.goods_sku.pass_length+jd_card_length)
										arr[i] = b+' '+c		
									}
				
									
								}else{
									let Jdarri_length =  this.goods_sku.card_short
									if(arr[i].length<this.goods_sku.card_short){
										Jdarri_length = this.goods_sku.card_short
									}else if (arr[i].length >= this.goods_sku.card_short && arr[i].length <= this.goods_sku.card_length){
										Jdarri_length = arr[i].length
									}else{
										Jdarri_length = this.goods_sku.card_length
									}
									arr[i] = arr[i]+arr[i+1]
									arr.splice(i+1,1)
									if(arr[i].indexOf(' ') === -1){
										
										jdarr = arr[i]
										if(arr[i].indexOf('-') != -1){
											jdarr = arr[i].replace(/[-]/g,'')
										}
										let jd_card_length =arr[i].length - jdarr.length
										let b  = arr[i].substring(0,Jdarri_length+jd_card_length)
										let c = arr[i].substring(Jdarri_length+jd_card_length)
										arr[i] = b+' '+c							
									}
								}
							}
						}
					}
					for(let i=0;i<arr.length;i++){
						let arrJd = arr[i]
						if(arr[i].indexOf('-') != -1){
							arrJd = arr[i].replace(/[-]/g,'')
						}
						
						if(arrJd.length > this.goods_sku.card_length && arrJd.indexOf(' ') === -1){
							let arrJd_length = arr[i].length-arrJd.length
							let jd_b = arr[i].substring(0,arr[i].length-this.goods_sku.pass_length + arrJd_length)
							let jd_c = arr[i].substring(arr[i].length-this.goods_sku.pass_length + arrJd_length)
							arr[i] = jd_b + ' ' +jd_c
						}
					}
					this.txt = arr.join('\n')
					let arr_bold_list = []
					let line_obj = arr.length - 1
					let arr_bold = arr[line_obj]
					if(arr_bold.indexOf('-') != -1){
						arr_bold = arr_bold.replace(/[-]/g,'')
					}
					if(arr[line_obj].indexOf(' ') === -1){
						if(arr_bold.length === this.goods_sku.card_length){
							arr[line_obj] = arr[line_obj] + ' '
							this.txt = arr.join('\n')
						}
					}
				
					if(arr_bold.length < this.goods_sku.card_short){
							arr[line_obj] = arr[line_obj].replace(/\s/g,'')
							this.txt = arr.join('\n')
					}
					if(arr[line_obj].indexOf(' ') != -1){
						let arr_jd = arr[line_obj].split(' ')
						if(arr_jd[1].indexOf('-') != -1){
							arr_jd[1] = arr_jd[1].replace(/[-]/g,'')
						}
						if(arr_jd[1].length === this.goods_sku.pass_length){
							this.txt +=  '\n'
						}
					}
					if(arr_bold.length < this.goods_sku.card_short){
						if(arr_bold.indexOf(' ') != -1){
							setTimeout(() => {
								arr[line_obj] = arr[line_obj].replace(/\s/g,"")
								this.txt = arr.join('\n')
							},100)
						}
					}
					this.line = arr.length
					setTimeout(() => {
						this.txt = this.txt.replace(/[^\d\w -- \n ]/g, '')
						this.txt = this.txt.replace(/[\u4E00-\u9FA5]/g,'')
					
					},100)
				
				}
				if(this.race.goods_name != "京东e卡(全品类)"){
					if(this.goods_sku.pass_g_type === 1 || this.goods_sku.card_g_type === 1){
							setTimeout(() => {
								this.txt = this.txt.replace(/[^\d\w : . / \n -- ; '' ""]/g, '')
								this.txt = this.txt.replace(/[\u4E00-\u9FA5]/g,'')
							},100)
					}else{
						setTimeout(() => {
							this.txt  = this.txt.replace(/[^A-Za-z0-9\u4e00-\u9fa5\s]/ig,'')
							this.txt = this.txt.replace(/[\u4E00-\u9FA5]/g,'')
						},100)
					}
				}
			},
			static_obj(str){
				str = String(str)
				let num = str.indexOf('.')
				if(num != -1){
					str = str.substring(0,num)
					return str
				}else{
					return str
				}
			},
			// 图片删除
			DelImg(e) {
				uni.showModal({
					title: '提示',
					content: '是否确定删除这张图片？',
					cancelText: '取消',
					confirmText: '确定',
					success: res => {
						if (res.confirm) {
							this.imgList.splice(e.currentTarget.dataset.index, 1)
						}
					}
				})
			},
			ViewImage(e) {
				uni.previewImage({
					urls: this.imgList,
					current: e.currentTarget.dataset.url
				});
			},
			// 上传图片
			ChooseImage() {
				let token = uni.getStorageSync("AccessToken")
				uni.chooseImage({
					count: 5, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (res) => {
						let a = JSON.stringify(res.tempFilePaths)
						let images = res.tempFilePaths
						const tempFilePaths = res.tempFilePaths;
						let number = 0
						this.imgUploading(images,tempFilePaths)
						//点击后图片更改状态由0变成1
					}
				});
			},
			// 图上上传
			imgUploading(images,tempFilePaths){
				let token = uni.getStorageSync("AccessToken")
				uni.showLoading({
					title: '上传中',
				})
				let promiseList = []
				images.forEach((item, index) => {
					promiseList.push(new Promise((resolve, reject) => {
						let url = config.apiUrl	
						let url_obj = url + '/api/upload/image'
						uni.uploadFile({
							url: url_obj, 
							filePath: item,
							// #ifndef MP-ALIPAY
							name: 'iFile',
							// #endif
							// #ifdef MP-ALIPAY
							fileName:"iFile",
							fileType:"image",
							// #endif
							formData: {
								wxapp_id: this.$wxapp_id,
								token: token,
							},
							success: (res) => {
								
								resolve(res)
								
							},
							fail: (e) => {
				
								reject(e)
							}
						});
					}))
				})
				let uploadImages = []
				let msg = []
				Promise.all(promiseList).then(res => {
					uni.hideLoading()
					let data = res
					
					data.forEach(item => {
				
						uploadImages.push(JSON.parse(item.data).data)
						msg.push(JSON.parse(item.data))
					})
					
					let list = []
					for(let i=0;i<uploadImages.length;i++){
						if(uploadImages[i].length === 0){
							uploadImages.splice(i,1)
						}
					}
			
					this.imgList = this.imgList.concat(uploadImages)
					// 单图片提交判断
					if(this.postType === 1){
						if(msg[0].code === 1){
							this.$toast(msg[0].msg)
						}else if (msg[0].code === 0){
							this.$toast(msg[0].msg)
						}
						if(this.imgList.length > 1){
							this.imgList.splice(1,this.imgList.length-1)
							this.$toast("单次提交图片最多上传1张")
						}
					}
					// 批量图片提交判断
					if(this.postType === 2){
						for(let i=0;i<msg.length;i++){
							if(msg[i].code === 0){
								this.$toast(msg[i].msg)
								return
							}
						}
						this.$Cmessage({msg:msg[0].msg},'success')
						if(this.imgList.length > 10){
							this.imgList.splice(10,this.imgList.length-10)
							this.$toast("批量提交图片最多上传10张")
						}
					}
				})
			},
			// 卡号卡密监听输入方法合集
			cardMethod(type_not,g_type,length,typeCard){
				if(this.race.goods_name === "京东e卡(全品类)" || this.goods_sku.form_num === 8){
					setTimeout(() => {
						type_not = type_not.replace(/\s/g,"")
						type_not = type_not.replace(/[\u4E00-\u9FA5]/g,'')
						type_not = type_not.replace(/[^\d\w -- \n ]/g, '')
						if(type_not.indexOf('-') != -1){
							let number = 0
							for(let i=0;i<type_not.length;i++){
								if(type_not[i] === '-'){
									number+=1
								}
							}
							let card_jd = type_not.replace(/[-]/g,'')
							if(card_jd.length > length){
								type_not = type_not.substring(0,length+number)
							}
						}else{
							if(type_not.length > length){
								type_not = type_not.substring(0,length)
							}
						}
						return typeCard===1?this.card = type_not:this.card_pass = type_not
					},100)
				}else{
					switch (g_type){
						case 1:
						setTimeout(() => {
							// 禁止输入空格
							type_not = type_not.replace(/\s/g,"")
							// 禁止输入非数字英文 ：. /
							type_not = type_not.replace(/[\u4E00-\u9FA5]/g,'')
							if(type_not.length > length){
								type_not = type_not.substring(0,length)
							}
							return typeCard===1?this.card = type_not:this.card_pass = type_not
						},100)
						break
						case 2:
						setTimeout(() => {
							type_not = type_not.replace(/[^A-Za-z]/g,'')
							
							if(type_not.length > length){
								type_not = type_not.substring(0,length)
							}
							return typeCard===1?this.card = type_not:this.card_pass = type_not
						},100)
						break
						case 3:
						setTimeout(() => {
							type_not = type_not.replace(/\D/g, '')
							if(type_not.length > length){
								type_not = type_not.substring(0,length)
							}
							return typeCard===1?this.card = type_not:this.card_pass = type_not
						},100)
						break
						case 4:
						setTimeout(() => {
							// 禁止输入空格
							type_not = type_not.replace(/\s/g,"")
							// 禁止输入非数字英文 ：. /
							type_not = type_not.replace(/[^A-Za-z0-9\u4e00-\u9fa5\s]/g, '')
							type_not = type_not.replace(/[\u4E00-\u9FA5]/g,'')
							if(type_not.length > length){
								type_not = type_not.substring(0,length)
							}
							return typeCard===1?this.card = type_not:this.card_pass = type_not
						},100)
						break
					}
				}
				
			},
			lineFeed(g_type,card,length){
				if(g_type != 1){
					return
				}
				var judgeFn = new RegExp(/\s+/g);
				if(judgeFn.test(card)){
					if(card.length > length){
						let blank = 0
						// let carriage = 0
						for(let i=0;i<card.length;i++){
							if(card[i] === ' ' || card[i] === '\n'){
								blank = i
								break
							}
							
						}
						this.card = card.substring(0,blank)
						this.card_pass = card.substring(blank)
					}
				}
			},
			judge_str(type,str,num){
				let _this = this
				let cardCase = num ===0?"卡号":"卡密"
				if (type === 2){
					let patrn = /^[a-zA-Z]*$/;
					if(!patrn.test(str)){
						this.$toast("请输入纯字母的"+cardCase)
						return
					}
				}else if (type === 3){
					let patrn = /^[0-9]*$/;
					if (!patrn.test(str)) {
						this.$toast("请输入纯数字的"+cardCase)
						return
					}
				}
			},
			// 卡号监听输入
			OnInput_card(e){
				this.judge_str(this.goods_sku.card_g_type,this.card,0)
				let card_length = this.goods_sku.card_length === 0?50:this.goods_sku.card_length
				this.lineFeed(this.goods_sku.card_g_type,this.card,card_length)
				this.cardMethod(this.card,this.goods_sku.card_g_type,card_length,1)
			},
			// 卡密监听输入
			OnInput(e){
				this.judge_str(this.goods_sku.pass_g_type,this.card_pass,1)
				let pass_length = this.goods_sku.pass_length === 0?50:this.goods_sku.pass_length
				this.cardMethod(this.card_pass,this.goods_sku.pass_g_type,pass_length,2)
			},
			activeType(index){
				this.postType = index
				this.imgList = []
				if(index === 2){
					
				}
			},
			//去掉面值小数点用于展示在预估时间
			tooltip1(num){
				if(num){
					if(num.indexOf('.') != -1){
						let list = num.split('.')
						if(list.length > 1){
							return list[0]
						}else{
							return num
						}
					}else{
						return num
					}
				}else{
					return num
				}
			},
			async handleKz(item){
				let _this = this
				_this.kind = item
				_this.race = {}
				_this.race_id = ""
				_this.goodsSkuList = []
				_this.goods_sku = {}
				await _this.getGoodsList()
				_this.openCardType()
			},
			handleFace(item,custom){
				this.goods_sku = item
				if(custom){
					this.custom_yes = custom
				}
			},
			handleCardType(item){
				this.race = item
				this.race_id = item.id
				this.goodsSkuList = item.products
				this.goods_sku = {}
				let num = this.wem_tc(item)
				num = this.th_tc(item)				if(num === 1){					this.openFace()				}
				
			},
			openFace(){
				this.$refs.goodsDetailPop.handFace(this.goodsSkuList,this.goods_sku,this.race)
			},
			openCardType(){
				this.$refs.goodsDetailPop.handType(this.goodsList,this.race,this.categoryList,this.kind)
			},
			openKz(){
				this.$refs.goodsDetailPop.handKz(this.categoryList,this.kind)
			},
			discount_show(price){
				return price.toFixed(2)
			},
			discount(price){
				let bool = false
				let number = 0
				for(let i=0;i<price.length;i++){
					if(price[i] == '.'){
						bool = true
					}
				}
				if(bool){
					return Number(price) / 100
					
				}else{
					return Number(price) / 100
				}
			},
			wem_tc(item){
				if(item.goods_name === "沃尔玛(已绑到微信的)"){
					// #ifdef MP-KUAISHOU || MP-BAIDU
					return
					// #endif
					this.$nextTick(() => {
						setTimeout(() => {
							this.$refs.goodsDetailPop.qykefu(1)
						},200)
					})

					
				}else{
					return 1 
				}
			},
			th_tc(item){

					return 1 
				
			},
			opinion_name(str){
				if(str === 1){
					if(this.userInfo.is_advanced === 1){
							return
					}else{
						this.$toast("此卡需要高级实名认证请先去高级实名认证")
						setTimeout(() => {
							// uni.navigateTo({
							// 	url:"/pageace_cart/pages/user/renzheng1"
							// })
						},1000)
					}
				}else{
					return
				}
			},
			userInfo_obj() {
				let token = uni.getStorageSync("AccessToken")
				let _this = this;
				userApi.userInfo({
						wxapp_id: _this.$wxapp_id,
						token: token,
					})
					.then(result => {
						let user = result.data
						if(user){
							this.userInfo = user
							this.opinion_name(this.goods_sku.g_real)
							uni.setStorageSync('userInfo',result.data);
						}
					})
			},
			async getInformation(options){
				let _this = this
				_this.kind = options
				_this.race_id = options.id
				_this.getCategoryList()
				await _this.getGoodsList()
				_this.openFace()
				_this.wem_tc(_this.race)
				_this.th_tc(_this.race)
			},
			getCategoryList() {
				let token = uni.getStorageSync("AccessToken")
				let _this = this;
				Api.list({
						wxapp_id: _this.$wxapp_id,
						token,
					})
					.then(result => {
						let list = result.data
						let img = [
							'../../static/home/iocn3.png',
							'../../static/home/iocn2.png',
							'../../static/home/ionc4.png',
							'../../static/home/iocn1.png',
							'../../static/home/iocn5.png',
							'../../static/home/iocn2.png',
							'../../static/home/iocn6.png',
							'../../static/home/iocn8.png',
						]
						let imgCss = [
							'classify-active1',
							'classify-active2',
							'classify-active3',
							'classify-active4',
							'classify-active5',
							'classify-active6',
							'classify-active7',
							'classify-active8'
						]
						for(let i=0;i<list.length;i++){
							if(i+1 > img.length ){
								list[i]['new_img'] = img[0]
								list[i]['new_class'] = imgCss[0]
							}else{
								list[i]['new_img'] = img[i]
								list[i]['new_class'] = imgCss[i]
							}
							if(list[i].name === '积分兑'){
								list.splice(i,1)
							}

						}

						_this.categoryList = list;
						
						_this.kind.cate_id = Number(_this.kind.cate_id)
						if (list.length > 0) {
							
							if(_this.kind.cate_id){
								for(let i=0;i<_this.categoryList.length;i++){
									if(_this.kind.cate_id === _this.categoryList[i].cate_id){
										_this.kind = _this.categoryList[i]
									}
								}
							}else{
								for(let i=0;i<_this.categoryList.length;i++){
									if(_this.kind.cate_id === _this.categoryList[i].cate_id){
										_this.kind = _this.categoryList[i]
									}
								}
							}
						}
					})
			},
			getGoodsList() {
				return new Promise((resolve,reject) => {
					let _this = this;
					let userinfo = uni.getStorageSync('userInfo')
					let user_id = userinfo?userinfo.user_id:''
					let token = uni.getStorageSync("AccessToken")
					let s = null
					// #ifdef MP-ALIPAY
					s = 1
					// #endif
					Api.detail({
							cate_id: _this.kind.cate_id,
							wxapp_id: _this.$wxapp_id,
							token,
							account :user_id,
							s
						})
						.then(result => {
							if (result.data.length > 0) {
								_this.goodsList = result.data
								_this.goodsSkuList=[]
								if (_this.race_id > 0) {
									for (var i = 0; i < result.data.length; i++) {
										if (_this.race_id == result.data[i].id) {
											_this.race = result.data[i];
										}
									}
								}else{
									_this.race = result.data[0]
									
								}
								let list = _this.race.products
								for(let i in list){
									_this.goodsSkuList.push(list[i])
								}
							}
			
							resolve("1")
						})
				})
			
			},
			//批量提交订单
			batchPostOrder() {
				if(this.goods_sku.form_num === 1 && this.goods_sku.card_length != 0 && this.goods_sku.pass_length != 0){
					this.clear1()
				}else{
					this.clear()
				}
				let _this = this;
				_this.isLoading = true;
				let batchBuy = [];
				this.new_batchBuy = []
				let txt = this.txt
				this.arr_submit = this.claernNull(this.arr_submit)
				// 无规则判断是否有多个空格
				if(this.goods_sku.form_num === 1){
					if(this.goods_sku.card_length === 0 || this.goods_sku.pass_length === 0){
						for(let i=0;i<this.arr_submit.length;i++){
							let sub_obj = ' '
							let count = 0
							for(let j=0;j<this.arr_submit[i].length;j++){
								if(this.arr_submit[i][j] === sub_obj){
									count += 1
								}
							}
							if(count > 1){
								this.$toast("请检查第"+(i+1)+'行是否有多余空格')
								return
							}
							if(count === 0){
								this.$toast("此卡需要卡号和卡密，请在卡号和卡密中间加上空格提交,请检查第"+(i+1)+"行是否有分割的空格")
								return
							}
						}
					}
					let card_length = this.goods_sku.card_length
					let pass_length = this.goods_sku.pass_length
					// 无规则卡密有规则判断卡密位数是否符合
					if(card_length === 0 && pass_length != 0){
						for(let i=0;i<this.arr_submit.length;i++){
							if(this.arr_submit[i].indexOf(' ') != -1){
								let str_arr = this.arr_submit[i].split(' ')
								if(str_arr[1].length != pass_length){
									this.$toast("请检查第"+(i+1)+"行卡密是否为"+pass_length+"位")
									return
								} 
							}else{
								this.$toast("请检查第"+(i+1)+"行，是否用空格隔开卡号与卡密")
								return
							}
							
						}
					}
					// 无规则卡号有规则判断卡号位数是否符合
					if(card_length != 0 && pass_length === 0){
						for(let i=0;i<this.arr_submit.length;i++){
							if(this.arr_submit[i].indexOf(' ') != -1){
								let str_arr = this.arr_submit[i].split(' ')
								if(str_arr[0].length != card_length){
									this.$toast("请检查第"+(i+1)+"行卡号是否为"+card_length+"位")
									return
								}
							}else{
								this.$toast("请检查第"+(i+1)+"行，是否用空格隔开卡号与卡密")
								return
							}
							
						}
					}
				}
				if(this.goods_sku.form_num == 1){
					if(this.goods_sku.card_length === 0 || this.goods_sku.pass_length === 0){
							this.new_batchBuy = this.arr_submit
					}else{
						for(let i=0;i<this.arr_submit.length;i++){
							
							if(this.arr_submit[i].indexOf(' ') === -1){
								this.$toast("此卡需要卡号和卡密，请在卡号和卡密中间加上空格提交,请检查第"+(i+1)+"行是否有分割的空格")
								return
							}
							let arr = this.arr_submit[i].split(' ')
							// 判断卡号位数是否符合
							let ifHint = this.batch_digit(this.goods_sku.card_short,this.goods_sku.card_length,arr[0].length,i,1)
							if(ifHint === 1){
								return
							}
							let abc = this.card_re(arr[0],1)
							if(abc){
								this.batch_verify(abc,1)
								return
							}
							// 判断卡密位数是否符合
							let ifHint_pass = this.batch_digit(this.goods_sku.pass_short,this.goods_sku.pass_length,arr[1].length,i,2)
							if(ifHint_pass){
								return
							}
							let number = this.card_re(arr[1],2)
							if(number){
								this.batch_verify(number,2)
								return
							}
						}
						this.new_batchBuy = this.arr_submit
					}
			
					// 单卡号或卡密判断
				}else if (this.goods_sku.form_num === 2  ){
					this.partition(this.txt)
					for(let i=0;i<this.arr_submit.length;i++){
						let arr = this.arr_submit[i]
						this.arr_submit[i] = arr.replace(/\s/g,"")
						if(this.goods_sku.card_length === 0){
							let number = this.card_re(arr,1)
							if(number){
								this.batch_verify(number,1)
								return
							}
						}else{
							let ifHint = this.batch_digit(this.goods_sku.card_short,this.goods_sku.card_length,arr.length,i,1)
							if(ifHint){
								return
							}
							let number = this.card_re(arr,1)
							if(number){
								this.batch_verify(number,1)
								return
							}
						}
					}
					this.new_batchBuy = this.arr_submit
				}else if(this.goods_sku.form_num === 3 || this.goods_sku.form_num === 8){
					this.partition(this.txt)
					for(let i=0;i<this.arr_submit.length;i++){
						let arr = this.arr_submit[i]
						this.arr_submit[i] = arr.replace(/\s/g,"")
						if(this.goods_sku.pass_length === 0){
							let number = this.card_re(arr,2)
							if(number){
								this.batch_verify(number,2)
								return
							}
						}else{
							if(this.goods_sku.form_num === 8){
								if(arr.indexOf('-') != -1){
									arr = arr.replace(/[-]/g,'')
								}
							}
							let ifHint_pass = this.batch_digit(this.goods_sku.pass_short,this.goods_sku.pass_length,arr.length,i,2)
							if(ifHint_pass){
								return
							}
							let number = this.card_re(arr,2)
							if(number){
								this.batch_verify(number,2)
								return
							}
							}
						}
						if(this.goods_sku.form_num === 8){
							for(let i=0;i<this.arr_submit.length;i++){
								if(this.arr_submit[i].indexOf('-') != -1){
									this.arr_submit[i] = this.arr_submit[i].replace(/[-]/g,'')
								}
								this.arr_submit[i] = this.arr_submit[i] + ' ' +this.arr_submit[i]
							}
						}
					this.new_batchBuy = this.arr_submit
				}else if(this.goods_sku.form_num === 4 || this.goods_sku.form_num === 6){
					// 图片以及二维码
					if(this.imgList){
						let file_id = []
						file_id = this.imgList.map(item => {
							return item.file_id
						})
						for(let i=0;i<file_id.length;i++){
							this.file_id.push(file_id[i])
						}
						this.new_batchBuy = this.file_id
					}else{
						this.$toast("请放入图片")
					}
				}else if(this.goods_sku.form_num === 5){
					this.arr_submit = this.text_tar_batch.split("\n")
					this.new_batchBuy = this.arr_submit
				}
				for(let i=0;i<this.new_batchBuy.length;i++){
					if(this.new_batchBuy[i] === '' || this.new_batchBuy[i] === " "){
						this.new_batchBuy.splice(i,1)
					}
				}
				
				if(this.goods_sku.term != -1){
					if(this.date != ''){
						let day = 0
						this.day_time2(this.date,this.date_now)
						
					}else{
						this.$toast("请输入有效期")
						return
					}
				
				}
				for(let i=0;i<this.new_batchBuy.length;i++){
					if(this.new_batchBuy[i] === '' || this.new_batchBuy[i] === " "){
						let str = "请检查第"+(i+1)+"行是否有多余空格"
						this.$toast(str)
						return
					}
				}
				if(this.new_batchBuy.length === 0){
			
					this.$toast('内容不能为空')
					return
				}
				// card = card.replace(/[o,O]/g,'0')
				// card_pass = card_pass.replace(/[o,O]/g,'0')
				if(this.race.goods_name === "京东e卡(全品类)" || this.goods_sku.form_num === 8){
					for(let i=0;i<this.new_batchBuy.length;i++){
						
						this.new_batchBuy[i] = this.new_batchBuy[i].replace(/[o,O]/g,'0')
					}
				}
				
				this.list_picnice(this.new_batchBuy)
				let repetiton = {
					repetiton:this.repetiton,
					line:this.line,
					old_line:this.old_line
				}
				this.$refs.popRestmain.batchOpen(this.goods_sku,this.race,this.custom_yes,'bath',repetiton)
			},
			// 单卡提交位数验证
			once_digit(length,maxlength,str,type){
				let _this = this 
				let str_type = type===1?"卡号":"卡密"
				if(length === 0 || maxlength === 0){
					return
				}
				if((length<=str && str<=maxlength)){
					
				}else{
					_this.$toast(str_type+"位数应为"+length+'位~'+maxlength+'位');
					return 1
				}
			},
			// 批量卡号卡密正则判断
			card_re(card,type){
				let _this = this
				let g_type = type === 1?_this.goods_sku.card_g_type:_this.goods_sku.pass_g_type
				
				if (g_type == 1) {
					//1不需要规则
					
				} else if (g_type == 2) {
					//2纯字母
					let patrn = /^[a-zA-Z]*$/;
					if (!patrn.test(card)) {
						return 2
					}
				} else if (g_type == 3) {
					//3纯数字
					let patrn = /^[0-9]*$/;
					if (!patrn.test(card)) {
						return 3
					}
				} else if (g_type == 4) {
					//4字母加数字
					let patrn = /^(?![^a-zA-Z]+$)(?!\D+$).{1,}$/
					if (!patrn.test(card)) { 
						return 4
					}
				}
			},
			// 单卡和批量是否符合规则方法
			batch_verify(number,type){
				let str = type === 1?"卡号":"卡密"
				if(number === 2){
					this.$toast("请输入纯字母的"+str)
					return 
				}else if (number === 3){
					this.$toast("请输入纯数字的"+str)
					return 
				}else if (number === 4){
					this.$toast("请输入字母加数字的"+str)
					return 
				}
			},
			oncePostOrder() {
				let _this = this;
				if(!this.goods_sku.form_num){
					this.$toast("请选择面值")
					return
				}
				if (_this.goods_sku.form_num == 1 || _this.goods_sku.form_num == 2 || _this.goods_sku.form_num == 7) {
					if (!_this.card) {
						this.$toast("请输入卡号")
						return 
					}
					if(_this.goods_sku.card_g_type == 1){
						
					}else{
						if(this.race.goods_name === "京东e卡(全品类)"){
							let card_jd_length = this.card.replace(/[-]/g,'')
							let digit = this.once_digit(this.goods_sku.card_short,this.goods_sku.card_length,card_jd_length.length,1)
							if(digit){
								return
							}
							let number = this.card_re(card_jd_length,1)
							if(number){
								this.batch_verify(number,1)
								return
							}
						}else{
							let digit = this.once_digit(this.goods_sku.card_short,this.goods_sku.card_length,this.card.length,1)
							if(digit){
								return
							}
							let number = this.card_re(this.card,1)
							if(number){
								this.batch_verify(number,1)
								return
							}
						}
					}
				}
				if (_this.goods_sku.form_num == 1 || _this.goods_sku.form_num == 3 || _this.goods_sku.form_num == 7 || _this.goods_sku.form_num === 8) {
			
					if (!_this.card_pass) {
						this.$toast("请输入卡密")
						return 
					}
					if(_this.goods_sku.pass_g_type  === 1){
						
					}else{
						if(this.race.goods_name === "京东e卡(全品类)" || this.race.goods_name === '京东e卡（全品类无卡号）'){
							let card_jd_pass_length = this.card_pass.replace(/[-]/g,'')
								let digit_pass = this.once_digit(this.goods_sku.pass_short,this.goods_sku.pass_length,card_jd_pass_length.length,2)
								if(digit_pass){
									return
								}
								let number = this.card_re(card_jd_pass_length,2)
								if(number){
									this.batch_verify(number,2)
									return
								}
			
					}else{
						let digit_pass = this.once_digit(this.goods_sku.pass_short,this.goods_sku.pass_length,this.card_pass.length,2)
						if(digit_pass){
							return
						}
						let number = this.card_re(_this.card_pass,2)
						if(number){
							this.batch_verify(number,2)
							return
						}
					}
					}
				}
				if(this.goods_sku.form_num === 4 || this.goods_sku.form_num === 6){
					if(this.imgList){
						let file_id = []
						this.file_id = this.imgList.map(item => {
							return item.file_id
						})
					}else{
						this.$toast("请放入图片")
						return
					}
				}
				if(this.goods_sku.form_num === 5){
					
				}
				if(this.goods_sku.term != -1 && this.goods_sku.form_num !=7){
					if(this.date != ''){
						let day = 0
						this.day_time2(this.date,this.date_now)
					}else{
						this.$toast("请选择有效期")
						return
					}
				}
				if(this.card){
					let str = this.card
					this.card = str.replace(/\s/g,"")
				}
				if(this.card_pass){
					let str = this.card_pass
					this.card_pass = str.replace(/\s/g,"")
				}
				if(this.race.goods_name === '瑞祥商联卡' || this.race.goods_name === '福卡(裕福)' || this.goods_sku.form_num === 9){
					if(!this.cvv_code ){
						this.$toast("请输入输入CVV码或验证码")
						return
					}
				}
				if(this.goods_sku.form_num === 7){
					if(this.date===''){
						this.$toast("请选择有效期")
						return
					}
				}
			
				this.$refs.popRestmain.batchOpen(this.goods_sku,this.race,this.custom_yes,'one')
			},
			// 批量位数判断方法
			batch_digit(length,maxLength,str,i,type){
				let strHint = type === 1?"卡号":"卡密"
			
				if(length <= str){
					if(str <= maxLength){
					}else{
						this.$toast("请检查第"+(i+1)+"行的"+strHint+"位数")
						return 1
					}
				}else{
					this.$toast("请检查第"+(i+1)+"行的"+strHint+"位数")
					return 1
				}
			},
			// 提交判断单卡或批量
			postOrder() {
				let token = uni.getStorageSync("AccessToken")
				if(token){
					if(this.userInfo.phone){
						if (this.postType == 1) {
							//单卡提交
							this.oncePostOrder();
						} else {
							//批量提交
							this.batchPostOrder();
							
						}
					}else{
						uni.showModal({
							title:"温馨提示",
							content:"提交卡劵需要先绑定手机号哦",
							showCancel:false,
							success: (res) => {
								if(res.confirm){
									uni.navigateTo({
										url:"/pages/user/user_item/bind_phone",
										})
								}
							}
						})
					}
				}else{
					uni.showModal({
						title:"温馨提示",
						content:"提交卡劵需要先登录哦",
						showCancel:false,
						success: (res) => {
							if(res.confirm){
								// #ifdef H5
								if(this.$fxLink.checkBrowser()){
									this.$Wxlogin.wxLogin()
								}else{
									this.$fxLink.checkLoinjudge()
								}
								// #endif
								// #ifndef H5
								this.$fxLink.checkLoinjudge()
								// #endif
							}
						}
					})
			
				}
			},
		}
	}
</script>

<style lang="scss">
    .marta{
        margin-bottom: 120rpx !important;
    }
    .bottom{
        background-color: #fff;
            width:calc(100vw - 64rpx);
            padding: 0 32rpx;
            padding-top: 20rpx;
            position: fixed;
            bottom: 0;
            left: 0;
            height: 106rpx;
            display: flex;
            justify-content: space-between;
            .bottom-left{
                .left{
                    display: flex;
                    margin-bottom: 10rpx;
                    .left-text{
                        height: 42rpx;
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 400;
                        font-size: 22rpx;
                        color: #626566;
                        line-height: 48rpx;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }
                   
                }
                .right-text{
                display: flex;
                    .text{
                        // width: 22rpx;
                        height: 30rpx;
                        font-family: PingFang SC, PingFang SC;
                        font-weight: 600;
                        font-size: 22rpx;
                        color: #FE3131;
                        line-height: 48rpx;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }
                    .num{
                        // width: 100rpx;
                        height: 40rpx;
                        font-family: D-DIN-DIN, D-DIN-DIN;
                        font-weight: bold;
                        font-size: 36rpx;
                        color: #FE3131;
                        line-height: 42rpx;
                        text-align: left;
                        font-style: normal;
                        text-transform: none;
                    }
                }
                
            }
            .bottom-right{
                 width: 332rpx;
                position: relative;
                .awal6{
                    position: absolute;
                    width: 332rpx;
                    height: 76rpx;
                    background: url('/static/awal6@2x.png') no-repeat;
                    background-size: 332rpx 76rpx; 
                }
                .text{
                     position: absolute;
                     width: 332rpx;
                     height: 76rpx;
                     font-family: PingFang SC, PingFang SC;
                     font-weight: 600;
                     font-size: 30rpx;
                     color: #FFFFFF;
                     line-height: 76rpx;
                     text-align: center;
                     font-style: normal;
                     text-transform: none;
                }
            }
        }
    
    .recycling{
        background-color:#F3F6F7;
        padding: 24rpx;
        .recycling-top{
            
            height: 326rpx;
            background: #FCFDFD;
            box-shadow: 0rpx 8rpx 40rpx 0rpx #E8EBEE;
            border-radius: 0rpx 0rpx 0rpx 0rpx;
            border: 4rpx solid #FFFFFF;
            .top-top{
                height: 146rpx;
                border-bottom: 1rpx solid #E6E6E6;
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin: 0 32rpx;
                .top-left{
                    display: flex;
                    .left-left{
                        .iocn5{
                            margin-right: 24rpx;
                            width: 80rpx;
                            height: 80rpx;
                            background: #F1F6F9;
                        }
                    }
                    .left-right{
                        .right-text{
                            margin-bottom: 10rpx;
                            display: flex;
                            .text{
                                // width: 120rpx;
                            font-family: PingFang SC, PingFang SC;
                                font-weight: 600;
                                font-size: 30rpx;
                                color: #333333;
                                line-height: 35rpx;
                                text-align: left;
                                font-style: normal;
                                text-transform: none;
                            }
                            .text-img{
                                position: relative;
                                display: flex;
                                align-items: center;
                                margin-left: 10rpx;
                                .Rectangle1{
                                    
                                    position: absolute;
                                    width: 122rpx;
                                    height: 32rpx;
                                }
                                .img-text{
                                    position: relative;
                                    height: 20rpx;
                                    font-family: D-DIN-DIN, D-DIN-DIN;
                                    font-weight: bold;
                                    font-size: 18rpx;
                                    color: #FFFFFF;
                                    line-height: 21rpx;
                                    text-align: left;
                                    font-style: normal;
                                    text-transform: none;
                                }
                                .Rectangle3{
                                    margin: 0 8rpx  0 10rpx;
                                    position: relative;
                                    width: 20rpx;
                                    height: 20rpx;
                                }
                            }
                        }
                        .right-wzi{
                            font-family: PingFang SC, PingFang SC;
                            font-weight: 400;
                            font-size: 22rpx;
                            color: #ABB0B2;
                            line-height: 26rpx;
                            text-align: left;
                            font-style: normal;
                            text-transform: none;
                        }
                    }
                }
                .top-right{
                    .Rectangle2{
                        width: 48rpx;
                        height: 48rpx;
                    }
                }
            }
            .mzhi{
               display: flex; 
               align-items: center;
               justify-content: space-between;
               padding:24rpx 32rpx;
               .mzhi-left{
                  .left-left{
                      .left-item{
                          display: flex;
                          margin:  15rpx 0;
                          .item-tite{
                             width: 120rpx;
                             height: 42rpx;
                             font-family: PingFang SC, PingFang SC;
                             font-weight: 400;
                             font-size: 30rpx;
                             color: #626566;
                             line-height: 35rpx;
                             text-align: left;
                             font-style: normal;
                             text-transform: none;
                          }
                          .item-num{
                              font-family: D-DIN-DIN, D-DIN-DIN;
                              font-weight: bold;
                              font-size: 34rpx;
                              color: #467EEB;
                              line-height: 40rpx;
                              text-align: left;
                              font-style: normal;
                              text-transform: none;
                          } 
                      }
                  } 
               }
               .mzhi-right{
                   .left{
                       width: 15rpx;
                       height: 25rpx;
                   }
               }
            }
        }
        .Card{
            margin-top: 24rpx;
            height: 188rpx;
            background: #FCFDFD;
            box-shadow: 0rpx 8rpx 40rpx 0rpx #E8EBEE;
            border-radius: 0rpx 0rpx 0rpx 0rpx;
            border: 4rpx solid #FFFFFF;
            padding: 32rpx;
           box-sizing: border-box;
           display: flex;
           flex-wrap: wrap;
             align-items: center;
            .Card-item{
                width: 100%;
                display: flex;
								justify-content: space-between;
                .item-left{
                    // width:50%;
										width: 100rpx;
                    height: 40rpx;
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 30rpx;
                    color: #333333;
                    line-height:40rpx;
                    text-align: left;
                    font-style: normal;
                    text-transform: none;
                }
                .item-right{
                    width:100%;
                    text-align: right;
                }
            }
        }
        .tji{
            margin: 24rpx 0;
           display: flex;
           justify-content: right;
            .tji-item{
               margin-right: 20rpx;
               height: 48rpx;
                height: 42rpx;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 30rpx;
                color: #9C8446;
                line-height: 42rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
                text-decoration-line: underline;
                  // box-shadow: 0 0 6rpx rgba(0,0,0,.12);
                  
            }
            // .tji-item:hover {
            //     background-color: rgb(240, 240, 240);
            //     color: #333333;
            // }
            
        }
        .tji1{
            // margin-bottom: 48rpx;
           display: flex;
           justify-content: space-between;
           align-items: center;
           .item-img{
               position: relative;
               .Rectangle4{
                   position: absolute;
                   width: 164rpx;
                   height: 48rpx;
               }
               .text{
                     position: relative;
                     width: 164rpx;
                     height: 48rpx;
                     font-family: PingFang SC, PingFang SC;
                     font-weight: 400;
                     font-size: 26rpx;
                     color: #FFFFFF;
                     line-height: 48rpx;
                     text-align: center;
                     font-style: normal;
                     text-transform: none;
               }
           }
            .tji-item{
                // padding: 10rpx;
                margin-right: 20rpx;
                height: 48rpx;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 30rpx;
                color: #9C8446;
                line-height: 48rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
                  text-decoration-line: underline;
                  // box-shadow: 0 0 6rpx rgba(0,0,0,.12);
            }
            // .tji-item:hover {
            //     background-color: rgb(240, 240, 240);
            //     color: #333333;
            // }
            
        }
        .item-text{
            margin: 24rpx 0;
            padding: 32rpx;
            box-sizing: border-box;
            height: 308rpx;
            background: #FCFDFD;
            box-shadow: 0rpx 8rpx 40rpx 0rpx #E8EBEE;
            border-radius: 0rpx 0rpx 0rpx 0rpx;
            border: 4rpx solid #FFFFFF;
            .txet{
                width: 100%;
                height: 100%;
            }
        }
        .user{
            margin-bottom: 24rpx;
             padding: 32rpx;
             // height: 334rpx;
             background: #FCFDFD;
             box-shadow: 0rpx 8rpx 40rpx 0rpx #E8EBEE;
             border-radius: 0rpx 0rpx 0rpx 0rpx;
             border: 4rpx solid #FFFFFF;
             box-sizing: border-box;
             .user-top{
                 height: 42rpx;
                 font-family: PingFang SC, PingFang SC;
                 font-weight: 600;
                 font-size: 30rpx;
                 color: #333333;
                 line-height: 35rpx;
                 text-align: left;
                 font-style: normal;
                 text-transform: none;
             }
             .user-text{
                 font-family: PingFang SC, PingFang SC;
                 font-weight: 400;
                 font-size: 26rpx;
                 color: #333333;
                 line-height: 44rpx;
                 text-align: left;
                 font-style: normal;
                 text-transform: none;
             }
        }
        .doling{
            // display: none;
            transition: all 0.25s linear ;
              // animation: fadein .5s;
              opacity: 0;
              z-index: -999;
            position: fixed;
            width: 100vw;
            height: 100vh;
            top: 0;
            left: 0;
            background: rgba(0,0,0,0.5);
            // z-index: 9;
            // display: flex;
            // align-items: self-end;
             padding-top: calc(100vh - 942rpx);

        }
    .listd{
        
         opacity: 1;
         z-index: 99;
          transition:all 0.3s linear;
           animation: fadein .5s;
    }
    .listdd{
         z-index: -99;
         opacity: 0;
            transition:all 0.4s linear;
         // animation: fadein1 .3s ;
          
    }
    // .fadein {
    //     animation: fadein .5s;
    // }
    @keyframes fadein {
        0% {
               transform: translate(0,100%);
           }
           100% {
               transform: none;
             
           }
    }
    @keyframes fadein1 {
         0% {
               opacity: 1;
            }
            100% {
               opacity: 0;
            }
    }
    }
		
		.picture{
		    // position: absolute;
		    left: 24rpx;
		    bottom: 24rpx;
		    width: 120rpx;
		    height: 120rpx;
		    background: #F5F8FA;
		    border-radius: 16rpx 16rpx 16rpx 16rpx;
		    display: flex;
		    flex-direction: column;
		    align-items: center;
		    justify-content: center;
		    // flex-wrap: wrap;
		    .imgs{
		        transition:  0.2s linear;
		        width: 40rpx;
		        height: 40rpx;
		        margin-bottom: 8rpx;

		    }
		    .text{
		        width: 90rpx;
		        height: 28rpx;
		        font-family: PingFang SC, PingFang SC;
		        font-weight: 300;
		        font-size: 20rpx;
		        color: #333333;
		        line-height: 23rpx;
		        text-align: left;
		        font-style: normal;
		        text-transform: none;
		    }
		}
		.uploadimg-preview{
			width: 120rpx;
			height: 120rpx;
		}
		.bg-img{
			margin-right: 16rpx;
		}
</style>